import {config} from '../config.js'
class HTTP{
    request(params){
        wx.request({
            url:config.api_base_url + params.url,
            data:params.data,
            method:params.method,
            success:(res)=>{
                let code = res.statusCode.toString()
                if (code.startsWith('2')){
                    params.success(res)
                }
                else{

                }
            },
            fail:(err)=>{

            }
        })

    }
}

export {HTTP}